package com.tanhua.domain.mongo;

import java.io.Serializable;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.bson.types.ObjectId;
import org.springframework.data.mongodb.core.mapping.Document;

@Data
@NoArgsConstructor
@Document(collection = "sound")
// 表示一个传音文件
public class Sound implements Serializable {
    private ObjectId id;      // 主键id
    private Long userId;      // 用户id
    private Long created;     // 创建时间，目前没用到，不过还是加上了
    private String soundUrl;  // 传音文件URL。FastDFS
    private String soundPath; // 传音文件路径，删除时用到

    public Sound(Long userId, String soundUrl, String soundPath) {
        this.userId = userId;
        this.created = System.currentTimeMillis();
        this.soundUrl = soundUrl;
        this.soundPath = soundPath;
    }
}
